<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">

        <link rel="shortcut icon" href="<!--{eval echo register_static('img/touch-icon-57x57.png');}-->">

        <title>粉粉管理系统</title>

        <!-- Bootstrap core CSS -->
        <link href="<!--{eval echo register_static('css/bootstrap.min.css');}-->" rel="stylesheet">
        <link href="<!--{eval echo register_static('css/bootstrap-reset.css');}-->" rel="stylesheet">

        <!--Animation css-->
        <link href="<!--{eval echo register_static('css/animate.css');}-->" rel="stylesheet">

        <!--Icon-fonts css-->
        <link href="<!--{eval echo register_static('assets/font-awesome/css/font-awesome.css');}-->" rel="stylesheet" />
        <link href="<!--{eval echo register_static('assets/ionicon/css/ionicons.min.css');}-->" rel="stylesheet" />
        
        <link href="<!--{eval echo register_static('assets/sweet-alert/sweet-alert.min.css');}-->" rel="stylesheet">
        
        <!-- Plugins css -->
        <link href="<!--{eval echo register_static('assets/modal-effect/css/component.css');}-->" rel="stylesheet">

        <!-- DataTables -->
        <link rel="stylesheet" href="<!--{eval echo register_static('assets/datatables/jquery.dataTables.min.css" rel="stylesheet');}-->" />

        <!-- Custom styles for this template -->
        <link href="<!--{eval echo register_static('css/style.css');}-->" rel="stylesheet">
        <link href="<!--{eval echo register_static('css/helper.css');}-->" rel="stylesheet">
        
        <!-- My styles for this template -->
        <link href="<!--{eval echo register_static('css/common.css');}-->" rel="stylesheet">

    </head>

    <body>

        <!-- Aside Start-->
        <!--{template admin_v2/leftside}-->
        <!-- Aside Ends-->


        <!--Main Content Start -->
        <section class="content">
            
            <!-- Header -->
            <!--{template admin_v2/header}-->
            <!-- Header Ends -->


            <!-- Page Content Start -->
            <!-- ================== -->

            <div class="wraper container-fluid diary-topics">
            
            	<div class="row">
                    <div class="col-md-12">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h3 class="panel-title">每日话题统计(前100条)</h3>
                            </div>
							<br>
							<div class="form-inline">
								<div class="form-group">
									<label>
									筛选:
									</label>
									<div class="form-group">
										<select class="form-control" id="category" name="category">
											<option value="1">话题回复数</option>
											<option value="2">话题查看数</option>
										</select>
									</div>
								</div>
								<div class="form-group">
									<input id="date" class="form-control" value="点击选择日期,默认前一天">
								</div>
							</div>
                            <div class="panel-body">
                                <div class="row">
                                    <div class="col-md-12 col-sm-12 col-xs-12">
                                        <table id="datatable" class="table table-striped table-bordered">
                                            <thead>
                                                <tr>
                            						 <th style="width:10%;">UID</th>
                            						 <th style="width:15%;">标题</th>
                            						 <th style="width:35%;">摘要</th>
                                                     <th style="width:15%;">圈子名</th>
                          							 <th style="width: 15%;">话题回复数</th>
                                                	 <th style="width: 10%;">话题查看数</th>
                                                </tr>
                                            </thead>

                                            <tbody id="viewList">
                                           
                                             </tbody>
                                         </table>
                                     </div>
                                 </div>
                             </div>
                         </div>
                     </div>
                 </div>

            </div>
            <!-- Page Content Ends -->
            <!-- ================== -->
            
            <div id="con-close-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
      
  			</div><!-- /.modal -->
            

            <!-- Footer Start -->
            <!--{template admin_v2/footer}-->
            <!-- Footer Ends -->



        </section>
        <!-- Main Content Ends -->


        <!-- js placed at the end of the document so the pages load faster -->
        <script src="<!--{eval echo register_static('js/jquery.js');}-->"></script>
        <script src="<!--{eval echo register_static('js/bootstrap.min.js');}-->"></script>
        <script src="<!--{eval echo register_static('js/pace.min.js');}-->"></script>
        <script src="<!--{eval echo register_static('js/wow.min.js');}-->"></script>
        <script src="<!--{eval echo register_static('js/jquery.nicescroll.js');}-->" type="text/javascript"></script>

		<script src="<!--{eval echo register_static('js/jquery.app.js');}-->"></script>
        <script src="<!--{eval echo register_static('laytpl/laytpl.js');}-->"></script>
		<script src="<!--{eval echo register_static('layer/layer.js');}-->"></script>
		<script src="<!--{eval echo register_static('laydate/laydate.js');}-->"></script>
        <script src="<!--{eval echo register_static('assets/datatables/jquery.dataTables.min.js');}-->"></script>
        <script src="<!--{eval echo register_static('assets/datatables/dataTables.bootstrap.js');}-->"></script>
        <script src="<!--{eval echo register_static('assets/sweet-alert/sweet-alert.min.js');}-->"></script>
        <script src="<!--{eval echo register_static('assets/sweet-alert/sweet-alert.init.js');}-->"></script>
        
        <!-- Modal-Effect -->
        <script src="<!--{eval echo register_static('assets/modal-effect/js/classie.js');}-->"></script>
        <script src="<!--{eval echo register_static('assets/modal-effect/js/modalEffects.js');}-->"></script>
        <script src="<!--{eval echo register_static('js/common.js');}-->"></script>
        <script id="list" type="text/html">
            {{# for(var i=0,len=d.length;i< len;i++){ }}
                <tr>
                    <td>{{d[i].uid}}</td>
                    <td><a target="_blank" href="http://ffweb.ffrj.net/group.php?ac=index&op=getTopicCommentList&tid={{d[i].tid}}&uid={{d[i].uid}}&gid={{d[i].tid}}">{{d[i].title}}</a></td>
                    <td>{{d[i].abbreviation}}</td>
                    <td>{{d[i].group.name}}</td>
                    <td>{{d[i].response_num}}</td>
                    <td>{{d[i].view_num}}</td>
                </tr>
            {{# } }}
        </script>
		<script type="text/javascript">
            var day = laydate.now(-1);
            var category = 1;
			laydate({
				elem: '#date',
				format: 'YYYY-MM-DD', // 分隔符可以任意定义，该例子表示只显示年月
				max: laydate.now(-1),
				choose: function(datas){ //选择日期完毕的回调
                    day = datas;
                    request(params(), displayRes);
				}
			});
            $(document).on('change','#category',function () {
                category = $(this).val();
                request(params(), displayRes);
            });
            $(function(){
                $('#date').val(day);
                request(params(), displayRes);
            });

            var displayRes = function(data){
                    laytpl($('#list').html()).render(data,function(html){
                        $('#viewList').html(html);
                    });
            }
            var params = function(){
               return {'type':category,'date':day,'action':'getTopic','do':'allGroupTopic'};
            }


        </script>
    </body>
</html>
